<script setup lang="ts">
import { ref } from 'vue'
// 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync()
const single = ref(0)
const imageValue = ref()
let checked = ref<boolean>(false)
</script>

<template>
  <view class="viewport">
    <!-- 表单 -->
    <view class="sche">
      <view class="sche-item">
        <text class="label">日程内容</text>
        <textarea placeholder="请输入日程内容" class="textarea" />
      </view>
    </view>
    <view class="form">
      <!-- 表单2内容 -->
      <view class="form-content">
        <view class="form-item">
          <text class="label">开始时间</text>
          <uni-datetime-picker :border="false" />
        </view>
        <view class="form-item">
          <text class="label">结束时间</text>
          <uni-datetime-picker :border="false" />
        </view>
      </view>
      <view class="form-content">
        <view class="form-item">
          <text class="label">日程提醒</text>
          <switch color="#FFCC33" style="transform: scale(0.7)" :checked="checked" />
        </view>
        <view class="form-item">
          <text class="label">日程备注</text>
          <input type="text" placeholder="请输入日程备注" />
        </view>
      </view>
      <view class="form-content">
        <view class="form-item">
          <text class="label">图片附件</text>
        </view>
      </view>
      <!-- 提交按钮 -->
      <button class="form-button">保 存</button>
    </view>
  </view>
</template>

<style lang="scss" scoped>
.sche {
  background-color: #fff;
  height: 330rpx;
  margin-top: 20rpx;
  .label {
    margin-left: 47rpx;
  }
  .sche-item {
    height: 100%;
    width: 100%;
    .textarea {
      width: 86%;
      height: 60%;
      border: 1px solid #ccc;
      padding: 2rpx;
      margin-left: 31rpx;
      margin-top: 20rpx;
      border-radius: 20rpx;
      padding: 20rpx;
    }
  }
}
page {
  background-color: #f4f4f4;
}

.viewport {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-size: auto 420rpx;
  background-repeat: no-repeat;
}

// 表单
.form {
  .textarea2 {
    width: 86%;
    height: 60%;
    border: 1px solid #ccc;
    padding: 2rpx;
    margin-left: 31rpx;
    margin-top: 20rpx;
    border-radius: 20rpx;
    padding: 20rpx;
  }
  background-color: #f4f4f4;

  &-content {
    margin: 20rpx 20rpx 0;
    padding: 0 20rpx;
    border-radius: 10rpx;
    background-color: #fff;
  }

  &-item {
    display: flex;
    height: 96rpx;
    line-height: 46rpx;
    padding: 25rpx 10rpx;
    background-color: #fff;
    font-size: 28rpx;
    border-bottom: 1rpx solid #ddd;
    &:last-child {
      border: none;
    }

    .label {
      width: 180rpx;
      color: #333;
    }

    .account {
      color: #666;
    }

    .input {
      flex: 1;
      display: block;
      height: 46rpx;
    }

    .radio {
      margin-right: 20rpx;
    }

    .picker {
      flex: 1;
    }
    .placeholder {
      color: #808080;
    }
  }

  &-button {
    height: 80rpx;
    text-align: center;
    line-height: 80rpx;
    margin: 30rpx 20rpx;
    color: #fff;
    border-radius: 80rpx;
    font-size: 30rpx;
    background-color: #ffcc33;
  }
}
</style>
